package com.ysu.shop.mapper;

import com.ysu.shop.pojo.Orders;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 耿志龙
 * @since 2020-10-01
 */
public interface OrdersMapper extends BaseMapper<Orders> {
    @Update("Update orders set status=2,payment_time=NOW(),shipping_id=#{shippingId} where order_no=#{orderNo} AND status=0 ")
    int payment(@Param("orderNo")String orderNo,@Param("shippingId") int shippingId);
    @Update("Update orders set status=1 where order_no=#{orderNo} AND status=0")
    int cancel(@Param("orderNo")String orderNo);
}
